import { axios } from '@/utils/request'

const prefix = '/leaseLossBills'
/**
 * 高级查询
 * @param params
 * @returns {AxiosPromise}
 */
export function superPageFetchList(params) {
  return axios({
    url: prefix + '/selectAll',
    method: 'GET',
    params: {
      ...params
    }
  })
}

/**
 * 新增
 * @param params
 * @returns {AxiosPromise}
 */
export function addObj(params) {
  return axios({
    url: prefix + '/insert',
    method: 'POST',
    data: {
      ...params
    }
  })
}

/**
 * 获取详情
 * @param id
 * @returns {AxiosPromise}
 */
export function getObj(id) {
  return axios({
    url: prefix+"/selectOne/"+id,
    method: 'GET'
  })
}

/**
 * 修改合同
 * @param params
 * @returns {AxiosPromise}
 */
export function updateObj(params) {
  return axios({
    url: prefix +'/update',
    method: 'put',
    data: {
      ...params
    }
  })
}


export function delObj(id) {
  return axios({
    url: prefix + '/deleteById' ,
    method: 'GET',
    params:{
      id:id
    }
  })
}

export function changState(id) {
  return axios({
    url: prefix + `/agreeState/${id}`,
    method: 'get'
  })
}

//审核通过
export function agreeBills(id) {
  return axios({
    url: prefix + '/agreeState/' + id,
    method: 'GET'
  })
}

//审核驳回
export function rejectedBills(id) {
  return axios({
    url: prefix + '/rejectedState/' + id,
    method: 'GET'
  })
}